﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:vm="clr-namespace:VmroleAuthor.ViewModels"
             xmlns:vw="clr-namespace:VmroleAuthor.Views" 
             x:Class="VmroleAuthor.Views.DeploySettingsPageView"
             mc:Ignorable="d" 
             d:DesignWidth="500"
             >
    <UserControl.Resources>     
        <Style TargetType="Control" x:Key="WizardInputErrorTemplate">
            <Setter Property="Validation.ErrorTemplate">
                <Setter.Value>
                    <ControlTemplate>
                        <Border BorderBrush="Red" BorderThickness="0.5" >
                            <AdornedElementPlaceholder Name="myControl"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="true">
                    <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
                </Trigger>
            </Style.Triggers>
        </Style>     
        <Style TargetType="PasswordBox" BasedOn="{StaticResource WizardInputErrorTemplate}" />
    </UserControl.Resources>
    <Grid VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="6" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>           
            <ColumnDefinition Width="6"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="72"/>
            <ColumnDefinition Width="6"/>
        </Grid.ColumnDefinitions>

        
        <!-- Application Properties -->
        <Grid Grid.Row="1" Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="1" Grid.Column ="1" FontSize="14" Text="{Binding SettingsTitle}" ToolTip="{Binding SettingsTitle}"/>
        </Grid>
        <!-- Parameter Settings -->
        <ScrollViewer  Grid.Row="2" Grid.Column="1"  CanContentScroll="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
            <ItemsControl BorderThickness="0" BorderBrush="Transparent" ItemsSource="{Binding ResExtDeploymentParamSettingViewModels}" HorizontalContentAlignment="Stretch">
               
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <ContentControl  Content="{Binding }" />
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
        <StackPanel Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal" Visibility="{Binding Path=WaitMessageVisibility}">
            <Image Height="20" Width="20"  Source="../Img/pending.png" VerticalAlignment="Center"/>
            <TextBlock FontSize="14" FontWeight="Normal"       
                VerticalAlignment="Center" 
                Foreground="{x:Static SystemColors.HotTrackBrush}"
                Text="{Binding Path=WaitMessage}"/>
        </StackPanel>
    </Grid>
</UserControl>
